'在桌面上生成 VS Code 的快捷方式。
Dim fso, objShell, link
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")

linkFile = objShell.SpecialFolders("Desktop") & "\VS Code.lnk"
isCreateShortcut = True

if fso.fileExists(linkFile) then
    if (MsgBox("快捷方式已经存在，是否覆盖？", 52, "请确认") = 7) then
        isCreateShortcut = False
    End if
End if

if isCreateShortcut then
    Set link = objShell.CreateShortcut(linkFile)
    jsDirectory = fso.GetFile(WScript.ScriptFullName).ParentFolder.Path
    link.TargetPath = jsDirectory & "\A launch.bat"
    link.Arguments = ""
    link.WindowStyle = 7
    link.IconLocation = jsDirectory & "\Code.exe"
    link.Description = "VS Code"
    link.WorkingDirectory = jsDirectory
    link.Save()
End if

WScript.quit